#include "VertexBuffer.hpp"
#include <vulkan/vulkan_raii.hpp>
#include "StagingBuffer.hpp"
void Lumine::VertexBuffer::Create(vk::DeviceSize size)
{
    // 创建Vertex Buffer
    StagingBuffer stagingBuffer;
    stagingBuffer.Create(size);
    // 将顶点数据保存到vertexBuffer
    void *dataStaging = stagingBuffer.MapMemory(size);
    memcpy(dataStaging, square.data(), (size_t)size);
    stagingBuffer.UnMapMemory();

    auto vertex_usage = vk::BufferUsageFlagBits::eVertexBuffer | vk::BufferUsageFlagBits::eTransferDst;
    auto vert_prop = vk::MemoryPropertyFlagBits::eDeviceLocal;
    createBuffer(size, vertex_usage, vert_prop, buffer, bufferMemory);
    copyBuffer(stagingBuffer.Buffer(), buffer, size);
}

void Lumine::VertexBuffer::Bind(const vk::raii::CommandBuffer &cmd)
{
}
